$(document).ready(function(){ 
  var chart = echarts.init($('#doc-statAllByFileExt-chart').get(0));
  chart.showLoading({
    text: "图表数据正在努力加载..."
  });
  var options = {      
      tooltip : {
          trigger: 'item',
          formatter: "{a} <br/>{b} : {c} ({d}%)"
      },
      legend: {
        orient : 'vertical',
        x : 'left',
        data:[]
      },
      toolbox: {
          show : true,
          feature : {
              //mark : {show: true},
              //dataView : {show: true, readOnly: false},
              magicType : {show: true, type: ['pie', 'funnel']},
              restore : {show: true}
          }
      },
      calculable : true,
      
      series : [
        {
          name:'访问来源',
          type:'pie',
          radius : '55%',
          center: ['50%', '60%'],
          data:[
              
          ]
        }          
      ]
  };
  
  $.webtools.ajax({
    isShowLoading: false,
    url: __CONTEXT_PATH+"/oa/shareFile/statAllByFileExt.json",
    params: {},
    success: function(reply) {
      options.legend.data = reply.categories;
      options.series[0].data = reply.pie.data;
      chart.hideLoading();
      chart.setOption(options);
      
    }
  });   
  
  
});